<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #date{
            width: 300px;
            height: 100px;
            background-color: rgb(101, 101, 255);
            
            text-align: center;
            color: white;
        }
        #time{
            font-size: 50px;
        }
    </style>
    <script>
        function showTime(){
           let today=new Date();
           let Y=today.getFullYear()
           let M=today.getMonth()+1
           let day=today.getDate()
           let week=today.getDay()
           switch(week){
               case 0:week="星期日";break;
               case 1:week="星期一";break;
               case 2:week="星期二";break;
               case 3:week="星期三";break;
               case 4:week="星期四";break;
               case 5:week="星期五";break;
               case 6:week="星期六";break;
          }
           document.getElementById("rq").innerHTML=Y+"年"+M+"月"+day+"日"+week
           let h=today.getHours();
           let m=today.getMinutes();
           let s=today.getSeconds();
           document.getElementById("time").innerHTML=h+":"+m+":"+s
       }
       let mytime=setInterval("showTime()",1000)
    </script>
</head>
<body>
    <div id="date">
        <div id="rq"></div>
        <div id="time"></div>
    </div>
</body>
</html>